package entity;

public class EintRegister extends ENumberRegister {
	private int value = -1;
	
	public EintRegister(String name, int address, String dataType,
			String description, String unit, double min, double max) {
		super(name, address, dataType, description, true, unit, min, max);
	}

	@Override
	public Object getValue() {
		return value;
	}

	@Override
	public void setValue(byte b0, byte b1, byte b2, byte b3) {
		int newValue = ((int) b0 & 0xff) + (((int) b1 & 0xff) << 8) 
						+ (((int) b2 & 0xff) << 16) + (((int) b3 & 0xff) << 24);

		this.value = newValue;
		setChanged();
		notifyObservers(value);
	}
}
